<?php
/**
 * The Header for our theme.
 *
 * Displays all of the <head> section and everything up till <div id="main">
 *
 * @package WordPress
 * @subpackage Twenty_Eleven
 * @since Twenty Eleven 1.0
 */
//ob_start();

?><!DOCTYPE html> 
<!--[if IE 6]>
<html id="ie6" <?php language_attributes(); ?>>
<![endif]-->
<!--[if IE 7]>
<html id="ie7" <?php language_attributes(); ?>>
<![endif]-->
<!--[if IE 8]>
<html id="ie8" <?php language_attributes(); ?>>
<![endif]-->
<!--[if !(IE 6) | !(IE 7) | !(IE 8)  ]><!-->
<html <?php language_attributes(); ?>>
<!--<![endif]-->
<head> 
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<meta name="viewport" content="width=device-width" />

<title><?php
	/*
	 * Print the <title> tag based on what is being viewed.
	 */
	global $page, $paged;

	wp_title( '|', true, 'right' );

	// Add the blog name.
	bloginfo( 'name' );

	// Add the blog description for the home/front page.
	$site_description = get_bloginfo( 'description', 'display' );
	if ( $site_description && ( is_home() || is_front_page() ) )
		echo " | $site_description";

	// Add a page number if necessary:
	if ( $paged >= 2 || $page >= 2 )
		echo ' | ' . sprintf( __( 'Page %s', 'twentyeleven' ), max( $paged, $page ) );

	?></title>
	
	


<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<script type="text/javascript" src="<?php echo get_template_directory_uri(); ?>/js/fbplugin.js"></script>
<?php 
$optionfb=get_option('bigckool_option_fb');
if(!empty($optionfb)){
?>
<script>

//check if website in iframe

//check if website in iframe

var windowWidth = window.screen.width < window.outerWidth ?
                window.screen.width : window.outerWidth;

if( (navigator.userAgent.match(/Android/i)
       || navigator.userAgent.match(/webOS/i)
       || navigator.userAgent.match(/iPhone/i)         
       || navigator.userAgent.match(/iPod/i)
       || navigator.userAgent.match(/BlackBerry/i)
       || navigator.userAgent.match(/Windows Phone/i))
	&& windowWidth < 500
       ){
//code for iPad here 

}
else{
	<?php if(!isset($_SESSION['m']) && DEBUG==0){?>
	if (window==window.top)window.location="<?php echo $optionfb['app_url']?>";	
<?php }?>
	
}


(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=<?php echo $optionfb['app_id']?>";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-6324518-10']);
_gaq.push(['_trackPageview']);

(function() {
  var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
  ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
  var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
			<?php }?>
			
			
<?php wp_head();
$catslug=get_query_var('category_name');
?>

<script>
//add app to fanpage tab
/*
						FB.ui({
  method: 'pagetab',
  redirect_uri: 'https://www.facebook.com/dialog/pagetab?app_id='+fbplugin.appID+'&redirect_uri=https://bigckool.itk.com.vn'
}, function(response){});

*/

//check user like
apppath='<?php echo APPPATH?>'; //default is '/'
fbplugin.appurl='<?php echo $optionfb['app_url']?>';
fbplugin.selfurl=fbplugin.appurl+'/'+document.location.pathname.replace(apppath,'');
fbplugin.fpurl='<?php echo $optionfb['fanpage_url']?>';
fbplugin.isUserlikeFP=false;
fbplugin.likeCount=0;
fbplugin.appID='<?php echo $optionfb['app_id']?>';
fbplugin.FPID='<?php echo $optionfb['fanpage_id']?>';
currenturls=location.href.split("?");
currenturl=currenturls[0];
urlredirect='<?php echo isset($_GET['r'])?$_GET['r']:''?>';
gULR='<?php echo get_template_directory_uri()?>';



</script>
</head>
<body>
<?php if( is_home() ){?>

<!--******************************
                LOADING 
        ******************************-->
        
    <div id="line" style="height:1px;position:fixed;top:50%;background-color:#44a9e1;z-index:9999;width:0"></div>
    <div id="top_loading" style="height:50%;position:fixed;top:0;background-color:white;z-index:9998;width:100%"></div>
    <div id="bottom_loading" style="height:50%;position:fixed;bottom:0;background-color:white;z-index:9998;width:100%"></div>

        <img src='' lazy-src='<?php echo get_template_directory_uri()?>/img/nav_bg.png' class='first bg_img' order='1' id='bg_loading' style='display:none'/>
        <img src='' lazy-src='<?php echo get_template_directory_uri()?>/img/parallaxbg_center.png' class='first bg_img' order='1' id='bg_loading' style='display:none'/>
        <img src='' lazy-src='<?php echo get_template_directory_uri()?>/img/parallaxbg_left.png' class='first bg_img' order='1' id='bg_loading' style='display:none'/>
        <img src='' lazy-src='<?php echo get_template_directory_uri()?>/img/parallaxbg_right.png' class='first bg_img' order='1' id='bg_loading' style='display:none'/>
        <img src='' lazy-src='<?php echo get_template_directory_uri()?>/img/home_bg.jpg' class='first bg_img' order='2' id='bg_loading' style='display:none'/>
        <img src='' lazy-src='<?php echo get_template_directory_uri()?>/img/content_bg.png' class='first bg_img' order='3' id='bg_loading' style='display:none'/>
        <img src='' lazy-src='<?php echo get_template_directory_uri()?>/img/giainhat_video_shadow.png' class='first bg_img' order='3' id='bg_loading' style='display:none'/>
		
        
 <?php }?>       
        
     <!--******************************
                    MENU 
            ******************************-->
            <div id="menu" >  
                    <img src='<?php echo get_template_directory_uri()?>/img/nav_select.png' id='selector' alt=''/>
                    <ul class='wrapper'>
                        <li style='margin-top:-4px' id='videoduthi' class='<?php echo $catslug=='tuan1'?'active_selector':''?>'>
                            <a href='<?php echo home_url('/category/tuan1/')?>'><img src='<?php echo get_template_directory_uri()?>/img/nav_videoduthi.png' atl=''/> </a>
                        </li>
                        <li style='margin-top:-9px' id='vongbanket' class='<?php echo $catslug=='vongbanket'?'active_selector':''?>'>
                            <a href='<?php echo home_url('/category/vongbanket/')?>'><img src='<?php echo get_template_directory_uri()?>/img/nav_vongbanket.png' atl=''/></a>
                        </li>
                        <li style='margin-top:-8px' id='vongchungket' class='<?php echo $catslug=='vongchungket'?'active_selector':''?>'>
                            <a href='<?php echo home_url('/category/vongchungket/')?>'><img src='<?php echo get_template_directory_uri()?>/img/nav_vongchungket.png' atl=''/></a>
                        </li>
                        <li id='thelechuongtrinh' class='<?php echo $pagename=='the-le'?'active_selector':''?>'>
                            <a href='<?php echo home_url('/the-le/')?>'><img src='<?php echo get_template_directory_uri()?>/img/nav_thelechuongtrinh.png' atl=''/></a>
                        </li>
                    </ul>
                
            </div>            
             <!--******************************
                    Header
            ******************************-->
		<?php if(! is_home() ){?>
		<div class='content_view'>
                <div class='content_bg'></div>
                    <div class='top_side' >
                        <div class='wrapper'>
                            <a href="<?php echo home_url('/')?>">
                                <img src='<?php echo get_template_directory_uri()?>/img/logo.png' alt='' class='logo float_left'/>
                            </a>                           
                            <img src='<?php echo get_template_directory_uri()?>/img/slogan.png' alt='' class='slogan float_right'/>
                        </div>
                        <div class='light'>
                            <img src='<?php echo get_template_directory_uri()?>/img/content_light1.png' alt='' id='light1' />
                            <img src='<?php echo get_template_directory_uri()?>/img/content_light2.png' alt='' id='light2' />
                        </div>
                    </div>
		<?php }?>
		
		
	